* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: #f5f5f5;
    font-family: Arial, sans-serif;
    font-size: 16px;
    width: 100%;
    min-height: 100vh;
}

.container {
    --face-happy: #ffdc3f;
    --face-cry: #429be0;

    max-width: 1200px;
    aspect-ratio: 4/3;
    margin: 50px auto;
    padding: 40px;
    display: flex;
    flex-flow: column nowrap;
    align-items: center;
    justify-content: space-between;
    border: 1px solid #ccc;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.face {
    position: relative;
    width: 50%;
    aspect-ratio: 1/1;
    border-radius: 50%;
    background-color: var(--face-happy);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    z-index: -2;

    &::after {
        content: "";
        position: absolute;
        inset: 0;
        opacity: var(--face-change-opacity);
        background: linear-gradient(to bottom, var(--face-cry), transparent var(--face-change-process));
        z-index: -1;
    }

    .eyes {
        position: absolute;
        top: 30%;
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 12%;

        .eye {
            position: relative;
            width: 25%;
            aspect-ratio: 1/1;
            border-radius: 50%;
            background-color: white;
            overflow: hidden;

            .pupil {
                position: absolute;
                width: 50%;
                aspect-ratio: 1/1;
                border-radius: 50%;
                background-color: black;
                transform: translate(-50%, -50%);
                transition: all 0.3s linear;
            }
        }

        .left__eye {
            .pupil {
                left: var(--eye-left-x);
                top: var(--eye-left-y);
            }
        }
        .right__eye {
            .pupil {
                left: var(--eye-right-x);
                top: var(--eye-right-y);
            }
        }
    }
    .cheeks {
        position: absolute;
        display: flex;
        justify-content: space-between;
        width: 80%;
        top: 54%;
        left: 50%;
        transform: translate(-50%);
        opacity: calc(100% - var(--face-change-process) * 1.5);
        .cheek {
            width: 20%;
            aspect-ratio: 3 / 2;
            border-radius: 50%;
            background-color: rgb(244, 192, 20);

            // &.left__cheek {
            //     transform: rotate(10deg);
            // }
            // &.right__cheek {
            //     transform: rotate(-10deg);
            // }
        }
    }
    .mouth {
        position: absolute;
        bottom: 20%;
        left: 50%;
        transform: translateX(-50%);
        width: 40%;
        aspect-ratio: 2/1;
        overflow: hidden;
        background-color: rgb(192, 73, 73);
        border-radius: var(--mouth-top-radius) var(--mouth-top-radius) var(--mouth-bottom-radius)
            var(--mouth-bottom-radius);
        transition: all 0.3s linear;

        .teeth {
            position: absolute;
            left: 60%;
            width: 15%;
            aspect-ratio: 2/1;
            background-color: white;
            border-radius: 0 0 10px 10px;
        }
        .tongue {
            position: absolute;
            bottom: 0;
            left: 20%;
            width: 50%;
            aspect-ratio: 3/1;
            background-color: rgb(140, 48, 48);
            border-radius: 9999px 9999px 0 0;
        }
    }
}

.action {
    width: 80%;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;

    button {
        padding: 10px 20px;
        border: none;
        border-radius: 5px;
        background-color: #4caf50;
        color: white;
        font-size: 16px;
        cursor: pointer;

        &:hover {
            background-color: #3e8e41;
        }
    }
    .right {
        background-color: rgb(179, 39, 39);

        &:hover {
            background-color: rgb(127, 28, 28);
        }
    }
}
